package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.CommentqueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    User selectByPrimaryKey(Long id);

    List<User> selectAll(QueryObject qo);

    int updateByPrimaryKey(User record);

    User selectByEmailAndPassword(@Param("email") String email, @Param("password") String password);

    boolean selectRelation(@Param("currentId") Long currentId, @Param("userId") Long userId);

    void insertRelation(@Param("currentId") Long currentId, @Param("userId") Long userId);

    void deleteRelation(@Param("currentId") Long currentId, @Param("userId") Long userId);

    void updateFansAndFollowersCount(User user);
    void updateState(@Param("id") Long id, @Param("stateDisable") long stateDisable);

}